package cn.lili.modules.member.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.distribution.entity.dos.Distribution;
import cn.lili.modules.member.entity.dos.UnionMember;
import cn.lili.modules.member.entity.vo.NumberOfOwners;
import cn.lili.modules.member.fallback.UnionMemberFallback;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.USER_SERVICE, contextId = "union-member", fallback = UnionMemberFallback.class)
public interface UnionMemberClient {

    @GetMapping("/feign/union/getUnionMemberPage")
    public List<Distribution> getUnionMemberPage(@RequestParam Integer pageNumber, @RequestParam Integer pageSize, @RequestParam String id, @RequestParam String memberName, @RequestParam String unionName);

    @GetMapping("/feign/union/numberOfOwners")
    public NumberOfOwners numberOfOwners(@RequestParam Integer type);

    @GetMapping("/feign/union/shopOwnersTurnover")
    public NumberOfOwners shopOwnersTurnover(@RequestParam Integer type);

//    @GetMapping("/feign/union/getUnionMemberList")
//    public List<UnionMember> getUnionMemberList();

    @PostMapping("/feign/union/getUnionMemberByIdList")
    List<UnionMember> getUnionMemberByIdList(@RequestBody List<String> idList);

    @PostMapping("/feign/getUnionMemberByUnionIdList")
    List<UnionMember> getUnionMemberByUnionIdList(@RequestBody List<String> unionIdList);

}
